home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 November / EnigmA AMIGA RUN 02 (1995)(G.R. Edizioni)(IT)[!][issue 1995-11][Skylink CD].iso / earcd / program / misc / door_io.readme < prev    next >
Text File  |  1995-09-22  |  4KB  |  94 lines

  1. Short:    BBS Door In/Out (Multiport)
  2. Author:   mac@casoconf.dontpanic.sub.org
  3. Uploader: farmer@casoconf.dontpanic.sub.org
  4. Type:     dev/misc
  5.  
  6.  
  7. Hi there.. this is the Documentation ;) for the door_io.library.
  8.  
  9. I have written it for all BBS-Door programmers (me included).
  10.  
  11. It should be very useful if one wants to input characters (a string) and react
  12. on events in parallel. This is important for MultiUserDungeons (MUD) and 
  13. related things.. I used on in a not_really_MUD named Gore. Its more a 
  14. MUDSG .. multiuserdungeonspladdergame.. 
  15.  
  16. Well.. it is not very funny if you are typing in a command, and when you are done 
  17. with it getting a message "a level 4711 Zombie has shaved you with a chainsaw" :))
  18.  
  19. An other Thing is the metacharacterexpander (what a word ..) 
  20. a "#" is used as a control character. the following character tells what happens:
  21. 0 -> color black
  22. 1 -> color red
  23. 2 -> color green
  24. 3 -> color blue
  25. 4 -> color yellow
  26. 5 -> color magenta
  27. 6 -> color cyan
  28. 7 -> color white
  29. n -> CR/LF
  30. s -> standard colors
  31.  
  32. These packetio-routines were originally not a shared lib, but we wanted to use the
  33. thing in a chatter-library (which will be soon available for AmBoS) and so
  34. the door_io.library was born :)
  35.  
  36. The library and all associated stuff is copyright by A.Haarer 1995+ and it
  37. may be freely used. It may be copied and spread on a non-profit basis.
  38. Commercial use is prohibited without written permission by Author .. ME !! :-)
  39.  
  40. Hum.. btw this program is thingware.. you may send anything to anyone :)
  41.  
  42. _______________________________________________________________________________
  43. Q: What is it for ??? 
  44.  
  45. A: Its a shared library that simplifies i/o operations in BBS-Cli-Doorprograms
  46.    - You are able to wait for Keys AND incoming exec-messages in parallel !
  47.    - You are able to specify a "carrier-lost-hook" to do cleanup when the line
  48.      breaks down
  49.    - it contains a metacharexpander which can generate colored output strings.
  50. ________________________________________________________________________________
  51. Q: How does it work ? 
  52.  
  53. A: The library does it's i/o operations by dospackets and therefore can wait()
  54.    for an input and other applicationspecific messages. The standard input() and
  55.    output() handles are used to determine the handler process.
  56. _________________________________________________________________________________
  57. Q: Why should i use it ? I can also poll the input stream  !
  58.  
  59. A: - Because polling in a multitasking environment ist complete bullshit ;-))
  60.    - Polling does slow down the whole system and is bad design, if other solutions
  61.      are possible.
  62.    - If you are polling single characters, you have to build a string input yourself.
  63.    - polling suxx :)
  64. _________________________________________________________________________________
  65. Q: How do i use it ?
  66.  
  67. A: - Replace your string input function by BOX_getstr()
  68.  
  69.    - Replace your string output function by BOX_getstr() and format the strings
  70.      with sprintf() when required.
  71.  
  72.    - Initialize the opened Library with BOX_start() and supply some parameters
  73.       - meta_on           1 -> the "#" controls the colors of text output
  74.                           0 -> the text output is not changed
  75.       - carrier_lost_hook (optional) is called when the handler returns an error
  76.                           (this is standard in most common bbs programs)
  77.       - exthandler        is called when one of the specified sigbits is set  
  78.       - sigmask           sigmask to trigger the exthandler
  79.  
  80.    - modify the signal mask by BOX_setmask() when required
  81.  
  82.    - Your carrier_lost_hook function should call BOX_stop() and close all resources of
  83.      your program
  84.  
  85.    - YOU MUST DECLARE BOTH HOOKFUNCTIONS with __saveds OR EQUIVALENT !
  86.      (__saveds restores the near data pointer, for some compilers its __geta4)
  87.  
  88.    - Call BOX_stop() when your program quits
  89. _________________________________________________________________________________
  90. Q: How contact the Author ? 
  91.  
  92. A: - Email to MAC@nasus.north.de or MAC@dontpanic.sub.org
  93.    - Call the Castle of Confusion BBS : +49 421 636 7544 or +49 421 636 8643
  94.